using System;
using System.Security.Permissions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Salient.Web.Administration
{
    [AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
    [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
    public class WebAdminUserControl : UserControl
    {
        #region DatabaseType enum

        public enum DatabaseType
        {
            Access = 0,
            Sql = 1,
        }

        #endregion

        private string _directionality;

        public string Directionality
        {
            get
            {
                if (String.IsNullOrEmpty(_directionality))
                {
                    _directionality =
                        ((string) GetGlobalResourceObject("GlobalResources", "HtmlDirectionality")).ToLower();
                }
                return _directionality;
            }
        }

        public HorizontalAlign DirectionalityHorizontalAlign
        {
            get
            {
                if (Directionality == "rtl")
                {
                    return HorizontalAlign.Right;
                }
                else
                {
                    return HorizontalAlign.Left;
                }
            }
        }

        public virtual bool OnNext()
        {
            return true; // move to next control.  Override to return false if next should not be honored.
        }

        public virtual bool OnPrevious()
        {
            return true; // move to next control.  Override to return false if prev should not be honored.
        }
    }
}